package com.guigu.controller;

import com.guigu.pojo.Stadia;
import com.guigu.pojo.Tickets;
import com.guigu.service.Tservice;
import com.guigu.vo.Pojo;
import com.guigu.vo.Vo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@CrossOrigin
@Controller
public class Tcontroller {
    @Autowired
    private Tservice tservice;
    @PostMapping("/select")
    @ResponseBody
    public Pojo<Tickets> select(@RequestBody Vo vo, Integer pageNo, Integer pageSize) {
        Pojo<Tickets> pojo = tservice.selectTickets(vo, pageNo, pageSize);
        System.out.println(pojo);
        return pojo;
    }
    @PostMapping("/selects")
    @ResponseBody
    public Pojo<Stadia> selects(@RequestBody Vo vo, Integer pageNo, Integer pageSize) {
        Pojo<Stadia> pojo = tservice.selectTicketsByCondition(vo, pageNo, pageSize);
        System.out.println(pojo);
        return pojo;
    }
    //打印
}
